<template>
  <!-- 姓名索引 -->
  <div>
    <h2>【姓名索引】</h2>
    <table class="index_table">
      <tr>
        <td>病案号</td>
        <td></td>
        <td>姓名</td>
        <td></td>
        <td>性别</td>
        <td></td>
      </tr>
      <tr>
        <td>通讯地址</td>
        <td colspan="3"></td>
        <td>年龄</td>
        <td></td>
      </tr>
      <tr>
        <td>邮政编码</td>
        <td></td>
        <td>电话</td>
        <td></td>
        <td>入院病情</td>
        <td></td>
      </tr>
      <tr>
        <td>入院诊断</td>
        <td colspan="3"></td>
        <td>入院日期</td>
        <td></td>
      </tr>
      <tr>
        <td>出院诊断</td>
        <td colspan="3"></td>
        <td>出院日期</td>
        <td></td>
      </tr>
      <tr>
        <td>ICD-10</td>
        <td></td>
        <td>转归</td>
        <td></td>
        <td>ICD-9</td>
        <td></td>
      </tr>
      <tr>
        <td>出院科别</td>
        <td></td>
        <td>损伤编码</td>
        <td></td>
        <td>M编码</td>
        <td></td>
      </tr>
      <tr>
        <td>总费用</td>
        <td></td>
        <td>住院天数</td>
        <td></td>
        <td>第几天确诊</td>
        <td></td>
      </tr>
      <tr>
        <td>主任医师</td>
        <td></td>
        <td>主治医师</td>
        <td></td>
        <td>住院医师</td>
        <td></td>
      </tr>
      <tr>
        <td>门诊医师</td>
        <td></td>
        <td>责任护士</td>
        <td></td>
        <td>编码员</td>
        <td></td>
      </tr>
    </table>
  </div>
</template>

<script>
import { deathIndex } from "@/api";
import { showOkMsg, showErrorMsg } from "@/utils/index.js";

export default {
  data() {
    return {
      tableData: []
    };
  },
  created() {
    this.getTableList();
  },
  props: ["dateList"],
  methods: {
    getTableList() {
      if (this.dateList.dateBegin && this.dateList.dateEnd) {
        deathIndex({
          startTime: this.dateList.dateBegin,
          endTime: this.dateList.dateEnd
        }).then(res => {
          if (res.code === 0) {
            this.startDate = this.dateList.dateBegin;
            this.endDate = this.dateList.dateEnd;
            this.tableData = res.data;
            showOkMsg(res.msg);
          }
        });
      } else {
        showErrorMsg("请选择开始或结束日期");
      }
    }
  }
};
</script>

<style scoped>
h1 {
  font-size: 24px;
  text-align: center;
  padding: 23px 0;
}
h3 {
  text-align: center;
  padding-bottom: 20px;
}
h2 {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
}
.index_table,
tr,
td {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #ebeef5;
}
.index_table td {
  width: 16.66%;
  padding: 0 10px;
  height: 49px;
  font-size: 14px;
  vertical-align: middle;
  color: #909399;
}
</style>